<div id="crop_image_monitor"></div>
<div id="toolbar-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
    <div id="toolbar" class="toolbar">
        <table class="toolbar"><tbody><tr>
                <td id="toolbar-save" class="button"><a class="toolbar" onClick="javascript: submitbutton('crop'); return false;" href="javascript:void(0);"> <span title="crop" class="icon-32-save"> </span> crop </a> </td>
        	<td id="toolbar-save" class="button"><a class="toolbar" onClick="javascript: submitbutton('save'); return false;" href="javascript:void(0);"> <span title="Save" class="icon-32-save"> </span> Save </a> </td>
	        <td id="toolbar-cancel" class="button"><a class="toolbar" onClick="javascript: submitbutton('cancel'); return false;" href="javascript:void(0);"> <span title="Cancel" class="icon-32-cancel"> </span> Cancel </a> </td>
        </tr></tbody></table>
    </div>
    <div class="header icon-48-user">chỉnh sửa nội dung nhạc</div>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
<div class="clr"></div>
<div id="submenu-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
    <ul id="submenu">
      <li> <a class="active" href="<?php echo $this->Html->url(array('controller'=>'musics', 'action'=>'index')); ?>">Nhạc</a> </li>
      <li> <a  href="<?php echo $this->Html->url(array('controller'=>'music_singers', 'action'=>'index')); ?>">Ca sỹ</a> </li>
      <li> <a  href="<?php echo $this->Html->url(array('controller'=>'music_styles', 'action'=>'index')); ?>">Thể loại nhạc</a> </li>

    </ul>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
<div id="element-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
<script language="javascript" type="text/javascript">
                $(document).ready(function(){
                     $('#img_130_130').Jcrop({
                        onChange: showCoords_130_130,
                        setSelect: [0,0, 130, 130]
                     });
                });
                function showCoords_130_130(c){
                    $('#crop_image_monitor').html('width:'+ c.w + ',height:' +  c.h);
                    $('#img_130_130_sx').val(c.x);
                    $('#img_130_130_sy').val(c.y);
                    $('#img_130_130_ex').val(c.x2);
                    $('#img_130_130_ey').val(c.y2);
                }
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
                if($('#GameTitle').val() == ''){
                    h3l_show_alert($('#GameTitle'), 'Vui lòng nhập title');
                    $('#GameTitle').focus();
                    return;
                }
                if($('#GameUrlGame').val() == ''){
                    h3l_show_alert($('#GameUrlGame'), 'Vui lòng nhập url');
                    $('#GameUrlGame').focus();
                    return;
                }
                if($('#GameCatId').val() == ''){
                    h3l_show_alert($('#GameCatId'), 'Vui lòng chọn 1 danh mục');
                    $('#GameCatId').focus();
                    return;
                }
                submitform( pressbutton );
	}
</script>
    <?php echo $this->Form->create('Music', array('type'=>'file', 'style'=> 'clear: both;', 'name'=>'adminForm', 'id'=>'adminForm')); ?>
      <div class="col">
        <fieldset class="adminform">
        <legend>Nhạc</legend>
        <table cellspacing="1" class="admintable">
          <tbody>
            <tr>
              <td width="150" class="key"><label for="title"> title </label>
              </td>
              <td>
                    <?php echo $this->Form->input('title', array('class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="published"> Published </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('published', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '1')); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="singer_id">Ca sỹ</label>
              </td>
              <td>
                    <?php echo $this->Form->select('singer_id', $singer_data, array('empty'=> true,'secure'=>true)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="style_id">Thể loại nhạc</label>
              </td>
              <td>
                    <?php echo $this->Form->select('style_id', $style_data, array('empty'=> true,'secure'=>true)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="hot_music">Hot music </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('hot_music', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '1')); ?>
              </td>
            </tr>
            <?php if($check_flash_exist): ?>
            <tr>
              <td width="150" class="key"><label for="preview">Preview </label>
              </td>
              <td>
                    
              </td>
            </tr>
            <tr>
              <td width="150" class="key">
              </td>
              <td>
                <a id="player" href="<?php echo $video_url; ?>" style="display:block;width:520px;height:330px"></a>
                <script language="javascript" type="text/javascript">
                    var params = {
                    };
                    flowplayer("player", "<?php echo $baseUrl . '/img/flowplayer/'; ?>/flowplayer-3.2.9.swf", params);
                </script>
              </td>
            </tr>
            <?php
                endif;
            ?>
            <tr>
              <td width="150" class="key"><label for="flash_path">upload flash </label>
              </td>
              <td>
                    <?php echo $this->Form->input('url', array('type'=>'file', 'class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>

            <?php if($check_thumbnail_exist): ?>
            <tr>
              <td width="150" class="key"><label for="preview">Preview </label>
              </td>
              <td>
                    <?php
                        echo $this->Html->image($image_url . '?rd=' . time(), array('id'=>'img_130_130'));
                    ?>
                    <?php echo $this->Form->input('delete_image', array('type'=>'checkbox', 'class'=>'inputbox', 'label'=> false)); ?>
                    Xóa Hình Này
                    <?php echo $this->Form->input('thumbnail', array('type'=>'hidden', 'name'=>'img_130_130_filename', 'id'=>'img_130_130_filename')); ?>
                    <?php echo $this->Form->input('img_130_130_sx', array('type'=>'hidden','name'=>'img_130_130_sx','id'=>'img_130_130_sx', 'value'=>0)); ?>
                    <?php echo $this->Form->input('img_130_130_sy', array('type'=>'hidden','name'=>'img_130_130_sy','id'=>'img_130_130_sy', 'value'=>0)); ?>
                    <?php echo $this->Form->input('img_130_130_ex', array('type'=>'hidden','name'=>'img_130_130_ex','id'=>'img_130_130_ex', 'value'=>130)); ?>
                    <?php echo $this->Form->input('img_130_130_ey', array('type'=>'hidden','name'=>'img_130_130_ey','id'=>'img_130_130_ey', 'value'=>130)); ?>
              </td>

            </tr>
            <?php
                endif;
            ?>
            <tr>
              <td width="150" class="key"><label for="thumbnail">Thumbnail </label>
              </td>
              <td>
                    <?php echo $this->Form->input('thumbnail', array('type'=>'file', 'class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>
            <tr>
              <td class="key"><label for="description">lời bài nhạc</label>
              </td>
              <td>
                    <?php echo $this->Editor->loadEditor('data[Music][description]', $description); ?>
              </td>
            </tr>
          </tbody>
        </table>
        </fieldset>
      </div>
      <div class="clr"></div>
      <?php echo $this->Form->input('id', array('type'=>'hidden')); ?>
      <input type="hidden" name="task" value="" />
    </form>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
